package com.yx.system.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yx.system.entity.SysUserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/** 用户与角色对应关系 Mapper 接口
 * Created by wuye on 2017/11/24.
 */
@Mapper
@Repository
public interface SysUserRoleDao extends BaseMapper<SysUserRole> {

    List<SysUserRole> queryList(Map<String, Object> map);

    /**
     * 根据用户ID，获取角色ID列表
     */
    List<Long> queryRoleIdList(Long userId);

    void save(Map<String, Object> map);

    int deleteByUserId(Long userId);

    List<Long> findByName(String 作者);

    void beauthor(@Param("userId") Long userId, @Param("roleId") Long i);
}